package descentFly.away3D4.element.Extends
{
	import UIFree.ObjectEvent;
	
	import descentFly.away3D4.element.df_element;
	import descentFly.sound.df_soundManager;
	
	public class df_medicineController extends df_distanceController {
		public function df_medicineController(a_ctrl:df_element, a_options:Object) {
			super(a_ctrl, a_options);
		}
		
		override protected function doNearest():void {
			var add: Number =myChip.maxLive * options.medicalPercent;
			if (add + myChip.live > myChip.maxLive) 
				add = myChip.maxLive - ctrl.Space.myChip.live;
			
			if (add > 0) {
				myChip.setLive(ctrl.Space.myChip.live + add);
				ctrl.pickUp();				
			}
			
			super.doNearest();
		}
	}
}